package com.example.demo6.SQLite;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface PickupGoodsDao {
    @Insert
    void insertPickupGoods(PickupGoods pickupGoods);
    @Delete
    void deletePickupGoods(PickupGoods pickupGoods);
    @Update
    void updatePickupGoods(PickupGoods pickupGoods);
    @Query("select * from pickupGoods where pickupId=:pickupId")
    PickupGoods getPickupGoodsByPickupId(int pickupId);

    @Query("select * from pickupGoods")
    LiveData<List<PickupGoods>> getPickupGoods();

    @Query("select * from pickupGoods where pickup=:Username")
    LiveData<List<PickupGoods>> getPickupGoodsByUsername(String Username);

    @Query("select * from pickupGoods where pickupId=:pickupId")
    PickupGoods getMyPickupGoodsByPickupId(int pickupId);
    @Update
    void updateMyPickupGoods(PickupGoods pickupGood);
    @Query("DELETE FROM PickupGoods WHERE PickupId = :PickupId")
    void deleteMyPickupGoodsById(int PickupId);
}
